package com.example.demo.service;

import com.example.demo.mapper.MessageMapper;
import com.example.demo.medol.MessageInfo;
import com.sun.xml.internal.ws.api.model.MEP;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Service
public class MessageSerivce {
    @Autowired
    private MessageMapper mapper;
    public void addMessage(MessageInfo messageInfo)
    {
        mapper.insertMessage(messageInfo);
    }
    public List<MessageInfo> getMessageInfo()
    {
        List messages=mapper.selectAll();
        return messages;
    }

}
